﻿using personalplaner.common;
using personalplaner.common.mvvm.factory;
using personalplaner.servicemodel.dataaccess;

namespace personalplaner.plugins.plananalysis.viewmodels.factories
{
	public class PlanAnalysisPluginModelFactory : IFactory
	{
		#region IFactory Members

		public object CreateViewModel(System.Windows.DependencyObject sender)
		{
            var vm = new PlanAnalysisPluginViewModel(sender);

            vm.ServiceLocator.RegisterService<IPersonDataAccess>(new PersonDataAccess(SettingsProvider.Settings));

			return vm;
		}

		#endregion
	}
}
